﻿<UserControl
    x:Class="GoogleSearch.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" 
    xmlns:uriMapper="clr-namespace:System.Windows.Navigation;assembly=System.Windows.Controls.Navigation"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:theme="clr-namespace:System.Windows.Controls.Theming;assembly=System.Windows.Controls.Theming.TwilightBlue"
    mc:Ignorable="d" d:DesignWidth="1100" d:DesignHeight="650">
    <theme:TwilightBlueTheme>
        <Grid x:Name="LayoutRoot" Style="{StaticResource LayoutRootGridStyle}">

            <Border x:Name="ContentBorder" Style="{StaticResource ContentBorderStyle}">
            
                <navigation:Frame x:Name="ContentFrame" Style="{StaticResource ContentFrameStyle}" 
                              Source="/Search" Navigated="ContentFrame_Navigated" NavigationFailed="ContentFrame_NavigationFailed">
                    <navigation:Frame.UriMapper>
                        <uriMapper:UriMapper>
                            <uriMapper:UriMapping Uri="" MappedUri="/Views/Search.xaml"/>
                            <uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml"/>
                        </uriMapper:UriMapper>
                    </navigation:Frame.UriMapper>
                </navigation:Frame>
            </Border>

            <Grid x:Name="NavigationGrid" Style="{StaticResource NavigationGridStyle}">

                <Border x:Name="BrandingBorder" Style="{StaticResource BrandingBorderStyle}">
                    <StackPanel x:Name="BrandingStackPanel" Style="{StaticResource BrandingStackPanelStyle}">

                        <Image Height="32" Source="Assets/google_logo.png"/>
                        <TextBlock x:Name="ApplicationNameTextBlock" Style="{StaticResource ApplicationNameStyle}" 
                               Text="Google Search" Margin="10,2,0,0"/>

                    </StackPanel>
                </Border>

                <Border x:Name="LinksBorder" Style="{StaticResource LinksBorderStyle}">
                    <StackPanel x:Name="LinksStackPanel" Style="{StaticResource LinksStackPanelStyle}">

                        <HyperlinkButton x:Name="Link1" Style="{StaticResource LinkStyle}" 
                                     NavigateUri="/Search" TargetName="ContentFrame" Content="search"/>

                        <Rectangle x:Name="Divider1" Style="{StaticResource DividerStyle}"/>

                        <HyperlinkButton x:Name="Link2" Style="{StaticResource LinkStyle}" 
                                     NavigateUri="/About" TargetName="ContentFrame" Content="about"/>
                        
                        <Rectangle x:Name="Divider2" Style="{StaticResource DividerStyle}"/>
                        
                        <Image x:Name="InstallImage" Source="Assets/install.png" ToolTipService.ToolTip="Install the application" Height="32" Cursor="Hand" MouseLeftButtonDown="InstallImage_MouseLeftButtonDown">                                                       
                        </Image>                        

                    </StackPanel>
                </Border>

            </Grid>

        </Grid>
    </theme:TwilightBlueTheme>
</UserControl>